﻿using System;
namespace Producers.Rr.Xtee.Riik.Ee.Producer.Rr {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="RR96Response_v1", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR96ResponseV1))]
    public class RR96ResponseV1Serializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IRR96ResponseV1 clazz;
        
        public RR96ResponseV1Serializer(IRR96ResponseV1 clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("Veakood");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Veakood))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("Veatekst");
            if (clazz.Veatekst!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Veatekst))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Veatekst");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Isikuandmed");
            if (clazz.Isikuandmed!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR96Response_v1>Isikuandmed>Isikuandmed", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Isikuandmed.Count);
                for (int x = 0; ((clazz.Isikuandmed != null) 
                            && (x < clazz.Isikuandmed.Count)); x = (x + 1)) {
                    if (clazz.Isikuandmed[x]!=null) {
                        Writer.WriteStartElement("Isikuandmed");
                        global::Xtee.Core.SerializationMetadata metaIsikuandmed = this.GetMetaData(clazz.Isikuandmed[x]);
                        Writer.WriteTypeAttribute(metaIsikuandmed.TypeQualifiedName.Namespace, metaIsikuandmed.TypeQualifiedName.Name);
                        metaIsikuandmed.NewSerializer(clazz.Isikuandmed[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Isikuandmed");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Dokumendiandmed");
            if (clazz.Dokumendiandmed!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Dokumendiandmed.Count);
                for (int x = 0; ((clazz.Dokumendiandmed != null) 
                            && (x < clazz.Dokumendiandmed.Count)); x = (x + 1)) {
                    if (clazz.Dokumendiandmed[x]!=null) {
                        Writer.WriteStartElement("Dokumendiandmed");
                        global::Xtee.Core.SerializationMetadata metaDokumendiandmed = this.GetMetaData(clazz.Dokumendiandmed[x]);
                        Writer.WriteTypeAttribute(metaDokumendiandmed.TypeQualifiedName.Namespace, metaDokumendiandmed.TypeQualifiedName.Name);
                        metaDokumendiandmed.NewSerializer(clazz.Dokumendiandmed[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Dokumendiandmed");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Suhe");
            if (clazz.Suhe!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR96Response_v1>Suhe>Suhe", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Suhe.Count);
                for (int x = 0; ((clazz.Suhe != null) 
                            && (x < clazz.Suhe.Count)); x = (x + 1)) {
                    if (clazz.Suhe[x]!=null) {
                        Writer.WriteStartElement("Suhe");
                        global::Xtee.Core.SerializationMetadata metaSuhe = this.GetMetaData(clazz.Suhe[x]);
                        Writer.WriteTypeAttribute(metaSuhe.TypeQualifiedName.Namespace, metaSuhe.TypeQualifiedName.Name);
                        metaSuhe.NewSerializer(clazz.Suhe[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Suhe");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Elukohaandmed");
            if (clazz.Elukohaandmed!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR96Response_v1>Elukohaandmed>Elukohaandmed", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Elukohaandmed.Count);
                for (int x = 0; ((clazz.Elukohaandmed != null) 
                            && (x < clazz.Elukohaandmed.Count)); x = (x + 1)) {
                    if (clazz.Elukohaandmed[x]!=null) {
                        Writer.WriteStartElement("Elukohaandmed");
                        global::Xtee.Core.SerializationMetadata metaElukohaandmed = this.GetMetaData(clazz.Elukohaandmed[x]);
                        Writer.WriteTypeAttribute(metaElukohaandmed.TypeQualifiedName.Namespace, metaElukohaandmed.TypeQualifiedName.Name);
                        metaElukohaandmed.NewSerializer(clazz.Elukohaandmed[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Elukohaandmed");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Kontaktandmed");
            if (clazz.Kontaktandmed!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR96Response_v1>Kontaktandmed>Kontaktandmed", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Kontaktandmed.Count);
                for (int x = 0; ((clazz.Kontaktandmed != null) 
                            && (x < clazz.Kontaktandmed.Count)); x = (x + 1)) {
                    if (clazz.Kontaktandmed[x]!=null) {
                        Writer.WriteStartElement("Kontaktandmed");
                        global::Xtee.Core.SerializationMetadata metaKontaktandmed = this.GetMetaData(clazz.Kontaktandmed[x]);
                        Writer.WriteTypeAttribute(metaKontaktandmed.TypeQualifiedName.Namespace, metaKontaktandmed.TypeQualifiedName.Name);
                        metaKontaktandmed.NewSerializer(clazz.Kontaktandmed[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kontaktandmed");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Hooldusoigused");
            if (clazz.Hooldusoigused!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR96Response_v1>Hooldusoigused>Hooldusoigused", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Hooldusoigused.Count);
                for (int x = 0; ((clazz.Hooldusoigused != null) 
                            && (x < clazz.Hooldusoigused.Count)); x = (x + 1)) {
                    if (clazz.Hooldusoigused[x]!=null) {
                        Writer.WriteStartElement("Hooldusoigused");
                        global::Xtee.Core.SerializationMetadata metaHooldusoigused = this.GetMetaData(clazz.Hooldusoigused[x]);
                        Writer.WriteTypeAttribute(metaHooldusoigused.TypeQualifiedName.Namespace, metaHooldusoigused.TypeQualifiedName.Name);
                        metaHooldusoigused.NewSerializer(clazz.Hooldusoigused[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Hooldusoigused");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="Veakood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR96Response_v1>Veakood");
                }
                clazz.Veakood = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("Veakood")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR96Response_v1>Veakood", Reader.LocalName);
            }
            if (Reader.LocalName=="Veatekst") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR96Response_v1>Veatekst");
                }
                clazz.Veatekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Veatekst")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR96Response_v1>Veatekst", Reader.LocalName);
            }
            if (Reader.LocalName=="Isikuandmed") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR96Response_v1>Isikuandmed");
                }
                clazz.Isikuandmed = new System.Collections.Generic.List<RR96ResponseV1.IIsikuandmedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Isikuandmed");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Isikuandmed")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR96Response_v1>Isikuandmed>Isikuandmed");
                        }
                        global::Xtee.Core.SerializationMetadata metaIsikuandmed = this.GetMetaData<RR96ResponseV1.IIsikuandmedType>(Reader, ">>>RR96Response_v1>Isikuandmed>Isikuandmed", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR96ResponseV1.IIsikuandmedType item = metaIsikuandmed.NewEntity<RR96ResponseV1.IIsikuandmedType>();
                        clazz.Isikuandmed.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Isikuandmed");
                            metaIsikuandmed.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR96Response_v1>Isikuandmed", Reader.LocalName);
            }
            if (Reader.LocalName=="Dokumendiandmed") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR96Response_v1>Dokumendiandmed");
                }
                clazz.Dokumendiandmed = new System.Collections.Generic.List<RR96ResponseV1.IDokumendiandmedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Dokumendiandmed");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Dokumendiandmed")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed");
                        }
                        global::Xtee.Core.SerializationMetadata metaDokumendiandmed = this.GetMetaData<RR96ResponseV1.IDokumendiandmedType>(Reader, ">>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR96ResponseV1.IDokumendiandmedType item = metaDokumendiandmed.NewEntity<RR96ResponseV1.IDokumendiandmedType>();
                        clazz.Dokumendiandmed.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Dokumendiandmed");
                            metaDokumendiandmed.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR96Response_v1>Dokumendiandmed", Reader.LocalName);
            }
            if (Reader.LocalName=="Suhe") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR96Response_v1>Suhe");
                }
                clazz.Suhe = new System.Collections.Generic.List<RR96ResponseV1.ISuheType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Suhe");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Suhe")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR96Response_v1>Suhe>Suhe");
                        }
                        global::Xtee.Core.SerializationMetadata metaSuhe = this.GetMetaData<RR96ResponseV1.ISuheType>(Reader, ">>>RR96Response_v1>Suhe>Suhe", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR96ResponseV1.ISuheType item = metaSuhe.NewEntity<RR96ResponseV1.ISuheType>();
                        clazz.Suhe.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Suhe");
                            metaSuhe.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR96Response_v1>Suhe", Reader.LocalName);
            }
            if (Reader.LocalName=="Elukohaandmed") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR96Response_v1>Elukohaandmed");
                }
                clazz.Elukohaandmed = new System.Collections.Generic.List<RR96ResponseV1.IElukohaandmedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Elukohaandmed");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Elukohaandmed")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR96Response_v1>Elukohaandmed>Elukohaandmed");
                        }
                        global::Xtee.Core.SerializationMetadata metaElukohaandmed = this.GetMetaData<RR96ResponseV1.IElukohaandmedType>(Reader, ">>>RR96Response_v1>Elukohaandmed>Elukohaandmed", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR96ResponseV1.IElukohaandmedType item = metaElukohaandmed.NewEntity<RR96ResponseV1.IElukohaandmedType>();
                        clazz.Elukohaandmed.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Elukohaandmed");
                            metaElukohaandmed.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR96Response_v1>Elukohaandmed", Reader.LocalName);
            }
            if (Reader.LocalName=="Kontaktandmed") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR96Response_v1>Kontaktandmed");
                }
                clazz.Kontaktandmed = new System.Collections.Generic.List<RR96ResponseV1.IKontaktandmedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Kontaktandmed");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Kontaktandmed")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR96Response_v1>Kontaktandmed>Kontaktandmed");
                        }
                        global::Xtee.Core.SerializationMetadata metaKontaktandmed = this.GetMetaData<RR96ResponseV1.IKontaktandmedType>(Reader, ">>>RR96Response_v1>Kontaktandmed>Kontaktandmed", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR96ResponseV1.IKontaktandmedType item = metaKontaktandmed.NewEntity<RR96ResponseV1.IKontaktandmedType>();
                        clazz.Kontaktandmed.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Kontaktandmed");
                            metaKontaktandmed.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR96Response_v1>Kontaktandmed", Reader.LocalName);
            }
            if (Reader.LocalName=="Hooldusoigused") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR96Response_v1>Hooldusoigused");
                }
                clazz.Hooldusoigused = new System.Collections.Generic.List<RR96ResponseV1.IHooldusoigusedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Hooldusoigused");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Hooldusoigused")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR96Response_v1>Hooldusoigused>Hooldusoigused");
                        }
                        global::Xtee.Core.SerializationMetadata metaHooldusoigused = this.GetMetaData<RR96ResponseV1.IHooldusoigusedType>(Reader, ">>>RR96Response_v1>Hooldusoigused>Hooldusoigused", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR96ResponseV1.IHooldusoigusedType item = metaHooldusoigused.NewEntity<RR96ResponseV1.IHooldusoigusedType>();
                        clazz.Hooldusoigused.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Hooldusoigused");
                            metaHooldusoigused.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR96Response_v1>Hooldusoigused", Reader.LocalName);
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR96Response_v1>Isikuandmed>Isikuandmed", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR96ResponseV1.IsikuandmedType))]
        public class IsikuandmedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR96ResponseV1.IIsikuandmedType clazz;
            
            public IsikuandmedTypeSerializer(RR96ResponseV1.IIsikuandmedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Isikuandmed.Isikukood");
                if (clazz.IsikuandmedIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Eesnimi");
                if (clazz.IsikuandmedEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Meesnm");
                if (clazz.IsikuandmedMeesnm!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedMeesnm))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedMeesnm");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Perenimi");
                if (clazz.IsikuandmedPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Mperenm");
                if (clazz.IsikuandmedMperenm!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedMperenm))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedMperenm");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Synniperenimi");
                if (clazz.IsikuandmedSynniperenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSynniperenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSynniperenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Sugu");
                if (clazz.IsikuandmedSugu!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSugu))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSugu");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.IsikuStaatus");
                if (clazz.IsikuandmedIsikuStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedIsikuStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedIsikuStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Synniaeg");
                if (clazz.IsikuandmedSynniaeg!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSynniaeg))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSynniaeg");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Surmaaeg");
                if (clazz.IsikuandmedSurmaaeg!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSurmaaeg))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSurmaaeg");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Kodakondsuskood");
                if (clazz.IsikuandmedKodakondsuskood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedKodakondsuskood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedKodakondsuskood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Kodakondsustekstina");
                if (clazz.IsikuandmedKodakondsustekstina!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedKodakondsustekstina))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedKodakondsustekstina");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Synnikoht");
                if (clazz.IsikuandmedSynnikoht!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSynnikoht))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSynnikoht");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Perekonnaseis");
                if (clazz.IsikuandmedPerekonnaseis!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedPerekonnaseis))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedPerekonnaseis");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.ElukRegpe");
                if (clazz.IsikuandmedElukRegpe!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedElukRegpe))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedElukRegpe");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Teovoime");
                if (clazz.IsikuandmedTeovoime!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedTeovoime))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedTeovoime");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.KirjeStaatus");
                if (clazz.IsikuandmedKirjeStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedKirjeStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedKirjeStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.SaabEestisse");
                if (clazz.IsikuandmedSaabEestisse!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSaabEestisse))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSaabEestisse");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.ViimatiPar");
                if (clazz.IsikuandmedViimatiPar!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedViimatiPar))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedViimatiPar");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.IsikuSeisund");
                if (clazz.IsikuandmedIsikuSeisund!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedIsikuSeisund))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedIsikuSeisund");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Andmed");
                if (clazz.IsikuandmedAndmed!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedAndmed))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedAndmed");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Emakeel");
                if (clazz.IsikuandmedEmakeel!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedEmakeel))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedEmakeel");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Rahvus");
                if (clazz.IsikuandmedRahvus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedRahvus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedRahvus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Haridus");
                if (clazz.IsikuandmedHaridus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedHaridus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedHaridus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.EKRIIK");
                if (clazz.IsikuandmedEKRIIK!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedEKRIIK))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedEKRIIK");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.EKmaakond");
                if (clazz.IsikuandmedEKmaakond!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedEKmaakond))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedEKmaakond");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.EKvald");
                if (clazz.IsikuandmedEKvald!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedEKvald))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedEKvald");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.EKasula");
                if (clazz.IsikuandmedEKasula!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedEKasula))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedEKasula");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Tegevusala");
                if (clazz.IsikuandmedTegevusala!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedTegevusala))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedTegevusala");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Amet");
                if (clazz.IsikuandmedAmet!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedAmet))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedAmet");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Eriala");
                if (clazz.IsikuandmedEriala!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedEriala))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedEriala");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Isanimi");
                if (clazz.IsikuandmedIsanimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedIsanimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedIsanimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.KoviSaabus");
                if (clazz.IsikuandmedKoviSaabus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedKoviSaabus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedKoviSaabus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Syriikkd");
                if (clazz.IsikuandmedSyriikkd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSyriikkd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSyriikkd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Syriiginimi");
                if (clazz.IsikuandmedSyriiginimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSyriiginimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSyriiginimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.ElukAlates");
                if (clazz.IsikuandmedElukAlates!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedElukAlates))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedElukAlates");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Isikuandmed.Isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Isikukood");
                    }
                    clazz.IsikuandmedIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Isikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Isikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Eesnimi");
                    }
                    clazz.IsikuandmedEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Eesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Meesnm") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Meesnm");
                    }
                    clazz.IsikuandmedMeesnm = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Meesnm")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Meesnm", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Perenimi");
                    }
                    clazz.IsikuandmedPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Perenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Perenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Mperenm") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Mperenm");
                    }
                    clazz.IsikuandmedMperenm = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Mperenm")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Mperenm", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Synniperenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Synniperenimi");
                    }
                    clazz.IsikuandmedSynniperenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Synniperenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Synniperenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Sugu") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Sugu");
                    }
                    clazz.IsikuandmedSugu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Sugu")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Sugu", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.IsikuStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.IsikuStaatus");
                    }
                    clazz.IsikuandmedIsikuStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.IsikuStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.IsikuStaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Synniaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Synniaeg");
                    }
                    clazz.IsikuandmedSynniaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Synniaeg")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Synniaeg", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Surmaaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Surmaaeg");
                    }
                    clazz.IsikuandmedSurmaaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Surmaaeg")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Surmaaeg", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Kodakondsuskood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Kodakondsuskood");
                    }
                    clazz.IsikuandmedKodakondsuskood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Kodakondsuskood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Kodakondsuskood", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Kodakondsustekstina") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Kodakondsustekstina");
                    }
                    clazz.IsikuandmedKodakondsustekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Kodakondsustekstina")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Kodakondsustekstina", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Synnikoht") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Synnikoht");
                    }
                    clazz.IsikuandmedSynnikoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Synnikoht")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Synnikoht", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Perekonnaseis") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Perekonnaseis");
                    }
                    clazz.IsikuandmedPerekonnaseis = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Perekonnaseis")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Perekonnaseis", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.ElukRegpe") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.ElukRegpe");
                    }
                    clazz.IsikuandmedElukRegpe = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.ElukRegpe")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.ElukRegpe", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Teovoime") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Teovoime");
                    }
                    clazz.IsikuandmedTeovoime = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Teovoime")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Teovoime", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.KirjeStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.KirjeStaatus");
                    }
                    clazz.IsikuandmedKirjeStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.KirjeStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.KirjeStaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.SaabEestisse") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.SaabEestisse");
                    }
                    clazz.IsikuandmedSaabEestisse = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.SaabEestisse")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.SaabEestisse", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.ViimatiPar") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.ViimatiPar");
                    }
                    clazz.IsikuandmedViimatiPar = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.ViimatiPar")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.ViimatiPar", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.IsikuSeisund") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.IsikuSeisund");
                    }
                    clazz.IsikuandmedIsikuSeisund = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.IsikuSeisund")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.IsikuSeisund", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Andmed") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Andmed");
                    }
                    clazz.IsikuandmedAndmed = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Andmed")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Andmed", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Emakeel") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Emakeel");
                    }
                    clazz.IsikuandmedEmakeel = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Emakeel")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Emakeel", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Rahvus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Rahvus");
                    }
                    clazz.IsikuandmedRahvus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Rahvus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Rahvus", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Haridus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Haridus");
                    }
                    clazz.IsikuandmedHaridus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Haridus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Haridus", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.EKRIIK") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.EKRIIK");
                    }
                    clazz.IsikuandmedEKRIIK = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.EKRIIK")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.EKRIIK", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.EKmaakond") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.EKmaakond");
                    }
                    clazz.IsikuandmedEKmaakond = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.EKmaakond")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.EKmaakond", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.EKvald") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.EKvald");
                    }
                    clazz.IsikuandmedEKvald = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.EKvald")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.EKvald", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.EKasula") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.EKasula");
                    }
                    clazz.IsikuandmedEKasula = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.EKasula")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.EKasula", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Tegevusala") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Tegevusala");
                    }
                    clazz.IsikuandmedTegevusala = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Tegevusala")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Tegevusala", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Amet") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Amet");
                    }
                    clazz.IsikuandmedAmet = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Amet")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Amet", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Eriala") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Eriala");
                    }
                    clazz.IsikuandmedEriala = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Eriala")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Eriala", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Isanimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Isanimi");
                    }
                    clazz.IsikuandmedIsanimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Isanimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Isanimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.KoviSaabus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.KoviSaabus");
                    }
                    clazz.IsikuandmedKoviSaabus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.KoviSaabus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.KoviSaabus", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Syriikkd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Syriikkd");
                    }
                    clazz.IsikuandmedSyriikkd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Syriikkd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Syriikkd", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Syriiginimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Syriiginimi");
                    }
                    clazz.IsikuandmedSyriiginimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Syriiginimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.Syriiginimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.ElukAlates") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.ElukAlates");
                    }
                    clazz.IsikuandmedElukAlates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.ElukAlates")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Isikuandmed>Isikuandmed>Isikuandmed.ElukAlates", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR96ResponseV1.DokumendiandmedType))]
        public class DokumendiandmedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR96ResponseV1.IDokumendiandmedType clazz;
            
            public DokumendiandmedTypeSerializer(RR96ResponseV1.IDokumendiandmedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Dokumendiandmed.Kood");
                if (clazz.DokumendiandmedKood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedKood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedKood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Nimetus");
                if (clazz.DokumendiandmedNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Seeria");
                if (clazz.DokumendiandmedSeeria!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedSeeria))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedSeeria");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Number");
                if (clazz.DokumendiandmedNumber!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedNumber))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedNumber");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokStaatus");
                if (clazz.DokumendiandmedDokStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokKontr");
                if (clazz.DokumendiandmedDokKontr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokKontr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokKontr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.AsutusRiik");
                if (clazz.DokumendiandmedAsutusRiik!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedAsutusRiik))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedAsutusRiik");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Asutus");
                if (clazz.DokumendiandmedAsutus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedAsutus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedAsutus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokValjastamisKuup");
                if (clazz.DokumendiandmedDokValjastamisKuup!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokValjastamisKuup))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokValjastamisKuup");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Sisestatud");
                if (clazz.DokumendiandmedSisestatud!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedSisestatud))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedSisestatud");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokSyndKuup");
                if (clazz.DokumendiandmedDokSyndKuup!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokSyndKuup))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokSyndKuup");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.KehtivAlates");
                if (clazz.DokumendiandmedKehtivAlates!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedKehtivAlates))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedKehtivAlates");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.KehtivKuni");
                if (clazz.DokumendiandmedKehtivKuni!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedKehtivKuni))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedKehtivKuni");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.IsikIsikukood");
                if (clazz.DokumendiandmedIsikIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedIsikIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedIsikIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokIsikukood");
                if (clazz.DokumendiandmedDokIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokPerekonnanimi");
                if (clazz.DokumendiandmedDokPerekonnanimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokPerekonnanimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokPerekonnanimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokEesnimi");
                if (clazz.DokumendiandmedDokEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Dok_osalus");
                if (clazz.DokumendiandmedDokOsalus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokOsalus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokOsalus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Teised_IsikIskood");
                if (clazz.DokumendiandmedTeisedIsikIskood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedTeisedIsikIskood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedTeisedIsikIskood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Teised_DokIskood");
                if (clazz.DokumendiandmedTeisedDokIskood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedTeisedDokIskood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedTeisedDokIskood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Teised_DokPerenimi");
                if (clazz.DokumendiandmedTeisedDokPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedTeisedDokPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedTeisedDokPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Teised_DokEesnimi");
                if (clazz.DokumendiandmedTeisedDokEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedTeisedDokEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedTeisedDokEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Teised_Dok_osalus");
                if (clazz.DokumendiandmedTeisedDokOsalus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedTeisedDokOsalus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedTeisedDokOsalus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokVanaEesnimi");
                if (clazz.DokumendiandmedDokVanaEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokVanaEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokVanaEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.DokVanaPerenimi");
                if (clazz.DokumendiandmedDokVanaPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedDokVanaPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedDokVanaPerenimi");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Dokumendiandmed.Kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Kood");
                    }
                    clazz.DokumendiandmedKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Kood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Kood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Nimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Nimetus");
                    }
                    clazz.DokumendiandmedNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Nimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Nimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Seeria") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Seeria");
                    }
                    clazz.DokumendiandmedSeeria = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Seeria")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Seeria", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Number") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Number");
                    }
                    clazz.DokumendiandmedNumber = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Number")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Number", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokStaatus");
                    }
                    clazz.DokumendiandmedDokStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokStaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokKontr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokKontr");
                    }
                    clazz.DokumendiandmedDokKontr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokKontr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokKontr", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.AsutusRiik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.AsutusRiik");
                    }
                    clazz.DokumendiandmedAsutusRiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.AsutusRiik")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.AsutusRiik", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Asutus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Asutus");
                    }
                    clazz.DokumendiandmedAsutus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Asutus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Asutus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokValjastamisKuup") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokValjastami" +
                                "sKuup");
                    }
                    clazz.DokumendiandmedDokValjastamisKuup = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokValjastamisKuup")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokValjastami" +
                            "sKuup", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Sisestatud") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Sisestatud");
                    }
                    clazz.DokumendiandmedSisestatud = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Sisestatud")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Sisestatud", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokSyndKuup") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokSyndKuup");
                    }
                    clazz.DokumendiandmedDokSyndKuup = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokSyndKuup")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokSyndKuup", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.KehtivAlates") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.KehtivAlates");
                    }
                    clazz.DokumendiandmedKehtivAlates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.KehtivAlates")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.KehtivAlates", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.KehtivKuni") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.KehtivKuni");
                    }
                    clazz.DokumendiandmedKehtivKuni = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.KehtivKuni")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.KehtivKuni", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.IsikIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.IsikIsikukood" +
                                "");
                    }
                    clazz.DokumendiandmedIsikIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.IsikIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.IsikIsikukood" +
                            "", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokIsikukood");
                    }
                    clazz.DokumendiandmedDokIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokIsikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokPerekonnanimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokPerekonnan" +
                                "imi");
                    }
                    clazz.DokumendiandmedDokPerekonnanimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokPerekonnanimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokPerekonnan" +
                            "imi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokEesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokEesnimi");
                    }
                    clazz.DokumendiandmedDokEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokEesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokEesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Dok_osalus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Dok_osalus");
                    }
                    clazz.DokumendiandmedDokOsalus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Dok_osalus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Dok_osalus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Teised_IsikIskood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_IsikIs" +
                                "kood");
                    }
                    clazz.DokumendiandmedTeisedIsikIskood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Teised_IsikIskood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_IsikIs" +
                            "kood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Teised_DokIskood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_DokIsk" +
                                "ood");
                    }
                    clazz.DokumendiandmedTeisedDokIskood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Teised_DokIskood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_DokIsk" +
                            "ood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Teised_DokPerenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_DokPer" +
                                "enimi");
                    }
                    clazz.DokumendiandmedTeisedDokPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Teised_DokPerenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_DokPer" +
                            "enimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Teised_DokEesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_DokEes" +
                                "nimi");
                    }
                    clazz.DokumendiandmedTeisedDokEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Teised_DokEesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_DokEes" +
                            "nimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Teised_Dok_osalus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_Dok_os" +
                                "alus");
                    }
                    clazz.DokumendiandmedTeisedDokOsalus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Teised_Dok_osalus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Teised_Dok_os" +
                            "alus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokVanaEesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokVanaEesnim" +
                                "i");
                    }
                    clazz.DokumendiandmedDokVanaEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokVanaEesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokVanaEesnim" +
                            "i", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.DokVanaPerenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokVanaPereni" +
                                "mi");
                    }
                    clazz.DokumendiandmedDokVanaPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.DokVanaPerenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.DokVanaPereni" +
                            "mi", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR96Response_v1>Suhe>Suhe", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR96ResponseV1.SuheType))]
        public class SuheTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR96ResponseV1.ISuheType clazz;
            
            public SuheTypeSerializer(RR96ResponseV1.ISuheType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Suhe.Suhtetyyp");
                if (clazz.SuheSuhtetyyp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheSuhtetyyp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheSuhtetyyp");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Isikukood");
                if (clazz.SuheIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Perenimi");
                if (clazz.SuhePerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuhePerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuhePerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Eesnimi");
                if (clazz.SuheEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Isanimi");
                if (clazz.SuheIsanimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheIsanimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheIsanimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Eesti_aadress");
                if (clazz.SuheEestiAadress!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheEestiAadress))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheEestiAadress");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Synnikoht");
                if (clazz.SuheSynnikoht!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheSynnikoht))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheSynnikoht");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.IsikuStaatus");
                if (clazz.SuheIsikuStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheIsikuStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheIsikuStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Staatus");
                if (clazz.SuheStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Alguskp");
                if (clazz.SuheAlguskp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheAlguskp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheAlguskp");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.Lopukp");
                if (clazz.SuheLopukp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheLopukp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheLopukp");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Suhe.IsikuIsikukood");
                if (clazz.SuheIsikuIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SuheIsikuIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SuheIsikuIsikukood");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Suhe.Suhtetyyp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Suhtetyyp");
                    }
                    clazz.SuheSuhtetyyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Suhtetyyp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Suhtetyyp", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Isikukood");
                    }
                    clazz.SuheIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Isikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Isikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Perenimi");
                    }
                    clazz.SuhePerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Perenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Perenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Eesnimi");
                    }
                    clazz.SuheEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Eesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Isanimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Isanimi");
                    }
                    clazz.SuheIsanimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Isanimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Isanimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Eesti_aadress") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Eesti_aadress");
                    }
                    clazz.SuheEestiAadress = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Eesti_aadress")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Eesti_aadress", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Synnikoht") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Synnikoht");
                    }
                    clazz.SuheSynnikoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Synnikoht")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Synnikoht", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.IsikuStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.IsikuStaatus");
                    }
                    clazz.SuheIsikuStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.IsikuStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.IsikuStaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Staatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Staatus");
                    }
                    clazz.SuheStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Staatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Staatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Alguskp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Alguskp");
                    }
                    clazz.SuheAlguskp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Alguskp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Alguskp", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.Lopukp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Lopukp");
                    }
                    clazz.SuheLopukp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.Lopukp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.Lopukp", Reader.LocalName);
                }
                if (Reader.LocalName=="Suhe.IsikuIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.IsikuIsikukood");
                    }
                    clazz.SuheIsikuIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Suhe.IsikuIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Suhe>Suhe>Suhe.IsikuIsikukood", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR96Response_v1>Elukohaandmed>Elukohaandmed", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR96ResponseV1.ElukohaandmedType))]
        public class ElukohaandmedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR96ResponseV1.IElukohaandmedType clazz;
            
            public ElukohaandmedTypeSerializer(RR96ResponseV1.IElukohaandmedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Elukohaandmed.Riigikood");
                if (clazz.ElukohaandmedRiigikood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedRiigikood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedRiigikood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Riiginimetus");
                if (clazz.ElukohaandmedRiiginimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedRiiginimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedRiiginimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.MaakonnaKood");
                if (clazz.ElukohaandmedMaakonnaKood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedMaakonnaKood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedMaakonnaKood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.MaakonnaNimetus");
                if (clazz.ElukohaandmedMaakonnaNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedMaakonnaNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedMaakonnaNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.VallaKood");
                if (clazz.ElukohaandmedVallaKood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedVallaKood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedVallaKood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.VallaNimetus");
                if (clazz.ElukohaandmedVallaNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedVallaNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedVallaNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.KylaKood");
                if (clazz.ElukohaandmedKylaKood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedKylaKood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedKylaKood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.KylaNimetus");
                if (clazz.ElukohaandmedKylaNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedKylaNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedKylaNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.VkohaNimetus");
                if (clazz.ElukohaandmedVkohaNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedVkohaNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedVkohaNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Tanav");
                if (clazz.ElukohaandmedTanav!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedTanav))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedTanav");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.NimeNimetus");
                if (clazz.ElukohaandmedNimeNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedNimeNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedNimeNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Majanr");
                if (clazz.ElukohaandmedMajanr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedMajanr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedMajanr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Korterinr");
                if (clazz.ElukohaandmedKorterinr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedKorterinr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedKorterinr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.AadressTekstina");
                if (clazz.ElukohaandmedAadressTekstina!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedAadressTekstina))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedAadressTekstina");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Postiindeks");
                if (clazz.ElukohaandmedPostiindeks!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedPostiindeks))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedPostiindeks");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Algusekuup");
                if (clazz.ElukohaandmedAlgusekuup!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedAlgusekuup))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedAlgusekuup");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Lopukuup");
                if (clazz.ElukohaandmedLopukuup!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedLopukuup))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedLopukuup");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.AadressiLiik");
                if (clazz.ElukohaandmedAadressiLiik!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedAadressiLiik))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedAadressiLiik");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.IsikuIsikukood");
                if (clazz.ElukohaandmedIsikuIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedIsikuIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedIsikuIsikukood");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Elukohaandmed.Riigikood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Riigikood");
                    }
                    clazz.ElukohaandmedRiigikood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Riigikood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Riigikood", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Riiginimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Riiginimetus");
                    }
                    clazz.ElukohaandmedRiiginimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Riiginimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Riiginimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.MaakonnaKood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.MaakonnaKood");
                    }
                    clazz.ElukohaandmedMaakonnaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.MaakonnaKood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.MaakonnaKood", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.MaakonnaNimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.MaakonnaNimetus");
                    }
                    clazz.ElukohaandmedMaakonnaNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.MaakonnaNimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.MaakonnaNimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.VallaKood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.VallaKood");
                    }
                    clazz.ElukohaandmedVallaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.VallaKood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.VallaKood", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.VallaNimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.VallaNimetus");
                    }
                    clazz.ElukohaandmedVallaNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.VallaNimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.VallaNimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.KylaKood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.KylaKood");
                    }
                    clazz.ElukohaandmedKylaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.KylaKood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.KylaKood", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.KylaNimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.KylaNimetus");
                    }
                    clazz.ElukohaandmedKylaNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.KylaNimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.KylaNimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.VkohaNimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.VkohaNimetus");
                    }
                    clazz.ElukohaandmedVkohaNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.VkohaNimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.VkohaNimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Tanav") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Tanav");
                    }
                    clazz.ElukohaandmedTanav = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Tanav")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Tanav", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.NimeNimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.NimeNimetus");
                    }
                    clazz.ElukohaandmedNimeNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.NimeNimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.NimeNimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Majanr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Majanr");
                    }
                    clazz.ElukohaandmedMajanr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Majanr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Majanr", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Korterinr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Korterinr");
                    }
                    clazz.ElukohaandmedKorterinr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Korterinr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Korterinr", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.AadressTekstina") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.AadressTekstina");
                    }
                    clazz.ElukohaandmedAadressTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.AadressTekstina")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.AadressTekstina", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Postiindeks") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Postiindeks");
                    }
                    clazz.ElukohaandmedPostiindeks = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Postiindeks")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Postiindeks", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Algusekuup") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Algusekuup");
                    }
                    clazz.ElukohaandmedAlgusekuup = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Algusekuup")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Algusekuup", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Lopukuup") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Lopukuup");
                    }
                    clazz.ElukohaandmedLopukuup = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Lopukuup")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.Lopukuup", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.AadressiLiik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.AadressiLiik");
                    }
                    clazz.ElukohaandmedAadressiLiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.AadressiLiik")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.AadressiLiik", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.IsikuIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.IsikuIsikukood");
                    }
                    clazz.ElukohaandmedIsikuIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.IsikuIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Elukohaandmed>Elukohaandmed>Elukohaandmed.IsikuIsikukood", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR96Response_v1>Kontaktandmed>Kontaktandmed", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR96ResponseV1.KontaktandmedType))]
        public class KontaktandmedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR96ResponseV1.IKontaktandmedType clazz;
            
            public KontaktandmedTypeSerializer(RR96ResponseV1.IKontaktandmedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Kontaktandmed.Sideaadress");
                if (clazz.KontaktandmedSideaadress!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KontaktandmedSideaadress))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KontaktandmedSideaadress");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Kontaktandmed.Liik");
                if (clazz.KontaktandmedLiik!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KontaktandmedLiik))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KontaktandmedLiik");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Kontaktandmed.Staatus");
                if (clazz.KontaktandmedStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KontaktandmedStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KontaktandmedStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Kontaktandmed.Alguskp");
                if (clazz.KontaktandmedAlguskp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KontaktandmedAlguskp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KontaktandmedAlguskp");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Kontaktandmed.Lopukp");
                if (clazz.KontaktandmedLopukp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KontaktandmedLopukp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KontaktandmedLopukp");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Kontaktandmed.IsikuIsikukood");
                if (clazz.KontaktandmedIsikuIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KontaktandmedIsikuIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KontaktandmedIsikuIsikukood");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Kontaktandmed.Sideaadress") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Sideaadress");
                    }
                    clazz.KontaktandmedSideaadress = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kontaktandmed.Sideaadress")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Sideaadress", Reader.LocalName);
                }
                if (Reader.LocalName=="Kontaktandmed.Liik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Liik");
                    }
                    clazz.KontaktandmedLiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kontaktandmed.Liik")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Liik", Reader.LocalName);
                }
                if (Reader.LocalName=="Kontaktandmed.Staatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Staatus");
                    }
                    clazz.KontaktandmedStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kontaktandmed.Staatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Staatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Kontaktandmed.Alguskp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Alguskp");
                    }
                    clazz.KontaktandmedAlguskp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kontaktandmed.Alguskp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Alguskp", Reader.LocalName);
                }
                if (Reader.LocalName=="Kontaktandmed.Lopukp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Lopukp");
                    }
                    clazz.KontaktandmedLopukp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kontaktandmed.Lopukp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.Lopukp", Reader.LocalName);
                }
                if (Reader.LocalName=="Kontaktandmed.IsikuIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.IsikuIsikukood");
                    }
                    clazz.KontaktandmedIsikuIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kontaktandmed.IsikuIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Kontaktandmed>Kontaktandmed>Kontaktandmed.IsikuIsikukood", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR96Response_v1>Hooldusoigused>Hooldusoigused", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR96ResponseV1.HooldusoigusedType))]
        public class HooldusoigusedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR96ResponseV1.IHooldusoigusedType clazz;
            
            public HooldusoigusedTypeSerializer(RR96ResponseV1.IHooldusoigusedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Hooldusoigused.hoRoll");
                if (clazz.HooldusoigusedhoRoll!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoRoll))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoRoll");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoLiik");
                if (clazz.HooldusoigusedhoLiik!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoLiik))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoLiik");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoSisu");
                if (clazz.HooldusoigusedhoSisu!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoSisu))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoSisu");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoTeineIK");
                if (clazz.HooldusoigusedhoTeineIK!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoTeineIK))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoTeineIK");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoTeineEesnimi");
                if (clazz.HooldusoigusedhoTeineEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoTeineEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoTeineEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoTeinePerenimi");
                if (clazz.HooldusoigusedhoTeinePerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoTeinePerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoTeinePerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoOlekStat");
                if (clazz.HooldusoigusedhoOlekStat!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoOlekStat))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoOlekStat");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoAlgus");
                if (clazz.HooldusoigusedhoAlgus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoAlgus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoAlgus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoLopp");
                if (clazz.HooldusoigusedhoLopp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoLopp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoLopp");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Hooldusoigused.hoPrimIsik");
                if (clazz.HooldusoigusedhoPrimIsik!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.HooldusoigusedhoPrimIsik))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : HooldusoigusedhoPrimIsik");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Hooldusoigused.hoRoll") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoRoll");
                    }
                    clazz.HooldusoigusedhoRoll = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoRoll")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoRoll", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoLiik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoLiik");
                    }
                    clazz.HooldusoigusedhoLiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoLiik")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoLiik", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoSisu") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoSisu");
                    }
                    clazz.HooldusoigusedhoSisu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoSisu")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoSisu", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoTeineIK") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoTeineIK");
                    }
                    clazz.HooldusoigusedhoTeineIK = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoTeineIK")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoTeineIK", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoTeineEesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoTeineEesnimi");
                    }
                    clazz.HooldusoigusedhoTeineEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoTeineEesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoTeineEesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoTeinePerenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoTeinePerenimi");
                    }
                    clazz.HooldusoigusedhoTeinePerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoTeinePerenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoTeinePerenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoOlekStat") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoOlekStat");
                    }
                    clazz.HooldusoigusedhoOlekStat = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoOlekStat")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoOlekStat", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoAlgus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoAlgus");
                    }
                    clazz.HooldusoigusedhoAlgus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoAlgus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoAlgus", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoLopp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoLopp");
                    }
                    clazz.HooldusoigusedhoLopp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoLopp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoLopp", Reader.LocalName);
                }
                if (Reader.LocalName=="Hooldusoigused.hoPrimIsik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoPrimIsik");
                    }
                    clazz.HooldusoigusedhoPrimIsik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Hooldusoigused.hoPrimIsik")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR96Response_v1>Hooldusoigused>Hooldusoigused>Hooldusoigused.hoPrimIsik", Reader.LocalName);
                }
            }
        }
    }
}
